import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

export function userLogout() {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/loginOut',
        method: 'get'
    })
}

export function UserList(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/getSysUserByPage',
        method: 'get',
        params
    })
}

export function SaveUser(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/addSysUser',
        method: 'post',
        data: params
    })
}
export function DelUser(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/deleteSysUser',
        method: 'get',
        params
    })
}
export function GetUser(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/findUserById',
        method: 'get',
        params
    })
}
export function UpdateUser(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/updateSysUser',
        method: 'post',
        data: params
    })
}
export function CheckUserName(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/checkUserName',
        method: 'get',
        params
    })
}
export function GetAllRole() {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/getAllSysRole',
        method: 'get',
    })
}
export function AuthUseru(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/authRolesByUserId',
        method: 'post',
        data: params
    })
}
export function FindByUserId(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/getRolesByUserId',
        method: 'get',
        params
    })
}
export function EditUserPassword(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/updatePassword',
        method: 'post',
        params
    })
}